package com.boot.security.server.dao;

import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.boot.security.server.model.AppVisitPay;

@Mapper
public interface AppVisitPayDao {
   // @Select("select * from app_visit_pay t where t.id = #{id}")
    @Select("select * from app_visit_pay ")
    AppVisitPay getById(Long id);

    AppVisitPay findInfo(@Param("params") AppVisitPay appVisitPay);

    @Delete("delete from app_visit_pay where id = #{id}")
    int delete(Long id);

    int update(AppVisitPay appVisitPay);
    
    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into app_visit_pay(visitpayid, hostcode, itemno, patientid, visitno, itemname, itemclass, paycosts, visitdate, prescno, serialno, units, price, amount, itemspec, performedby, orderedby, dqbm, phone,cardno,cardtype,idcard,idcardtype,feelevel,usage,dose,doseage,days,fee,recipettype,groupid,tradeno,payable,unpayablereason,rtsettlement,paystaus) values(#{visitpayid}, #{hostcode}, #{itemno}, #{patientid}, #{visitno}, #{itemname}, #{itemclass}, #{paycosts}, #{visitdate}, #{prescno}, #{serialno}, #{units}, #{price}, #{amount}, #{itemspec}, #{performedby}, #{orderedby}, #{dqbm}, #{phone}, #{cardno}, #{cardtype}, #{idcard}, #{idcardtype}, #{feelevel}, #{usages}, #{dose}, #{doseage}, #{days}, #{fee}, #{recipettype}, #{tradeno}, #{groupid}, #{payable}, #{unpayablereason}, #{rtsettlement}, #{paystaus})")
    int save(AppVisitPay appVisitPay);
    
    int count(@Param("params") Map<String, Object> params);

    List<AppVisitPay> list(@Param("params") Map<String, Object> params, @Param("offset") Integer offset, @Param("limit") Integer limit);
}
